﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DnD.Model
{
    class DnDAction : GameItem
    {

        private EntitySet<CardAction> _cards;
        private int _amount;

        public DnDAction()
        {


            this.Local = true;
            this.Rate = 0;
            this.RateCount = 0;
            this.Amount = 0;

            _cards = new EntitySet<CardAction>();
        }


        public DnDAction(String name, String description, String pictureURL)
        {
            this.Name = name;
            this.Description = description;
            this.PictureURL = pictureURL;
           

            this.Local = true;
            this.Rate = 0;
            this.RateCount = 0;
            this.Amount = 1;

            _cards = new EntitySet<CardAction>();
        }

        [Association(Storage = "_cards", OtherKey = "ActionID")]
        public EntitySet<CardAction> Cards
        {
            get { return _cards; }
            set
            {
                _cards.Assign(value);
                OnPropertyChanged();
            }
        }



        [Column(CanBeNull=true)]
        public int Amount
        {
            get { return _amount; }
            set
            {
                _amount = value;
                OnPropertyChanged();
            }
        }

    }
}
